home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_actor_turner.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  80 lines

  1. # Jones 3D Cog Script
  2. #
  3. # actor_Turner.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13.     message        created
  14.     message        damaged
  15.  
  16.     model        head0=head_tu_asound.3do    local
  17.     model        head1=head_tu_amsound.3do    local
  18.     model        head2=head_tu_osound.3do    local
  19.  
  20.     sound        snd0=inxt001.wav            local    # "Don't shoot!"
  21.     sound        snd1=inxt002.wav            local    # "Watch what you're doing!"
  22.     sound        snd2=inxt003.wav            local    # "Hey, take it easy, pal!"
  23.  
  24.     thing        turner                        local
  25.  
  26.     int            newLine                        local
  27.     int            lastLine=-1                    local
  28.  
  29.     int            bTalking=0                    local
  30.  
  31. end
  32.  
  33. # ===================================================================
  34.  
  35. code
  36.  
  37. created:
  38.  
  39.     turner = GetSenderRef();
  40.     SetThingVoiceHeads(turner, "inhead", "", "head_tu_asound.3do", "head_tu_amsound.3do", "head_tu_osound.3do");
  41.     return;
  42.  
  43. # -------------------------------------------------------------------
  44.  
  45. damaged:
  46.  
  47.     if (GetThingParent(GetSourceRef()) != GetLocalPlayerThing()) return;
  48.  
  49.     if (bTalking) return;
  50.  
  51.     bTalking = 1;
  52.  
  53.     turner = GetSenderRef();
  54.  
  55.     # Impact damage
  56.     if (BitTest(GetParam(1), 0x1))
  57.     {
  58.         while (newLine == lastLine)
  59.         {
  60.             newLine = RandBetween(0, 2);
  61.         }
  62.     }
  63.     # Anything else
  64.     else
  65.     {
  66.         while (newLine == lastLine)
  67.         {
  68.             newLine = RandBetween(1, 2);
  69.         }
  70.     }
  71.  
  72.     # Start the voice & wait...
  73.     PlayVoice(turner, snd0[newLine], 1.0, 1);
  74.  
  75.     bTalking = 0;
  76.     lastLine = newLine;
  77.  
  78.     return;
  79.  
  80. end